//Copyright (C) 2011 Ron Coleman. Contact: ronncoleman@gmail.com
//
//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 3 of the License, or (at your option) any later version.
//
//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this library; if not, write to the Free Software
//Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

package org.workplicity.cia.worklet;

import org.workplicity.cia.ui.MainFrame;
import org.workplicity.cia.util.TradesCache;
import org.workplicity.plugin.worklet.Plugin;
import org.workplicity.worklet.Worklet;
import org.workplicity.worklet.WorkletContext;

/**
 * This class implements the elog worklet.
 * @author Ron Coleman
 */
public class ElogsWorklet extends Plugin implements Worklet {
    private static ElogsWorklet worklet = null;
    private TradesCache trades;

    public void go(WorkletContext context) {
        worklet = this;

        this.context = context;

        trades = new TradesCache();

        MainFrame.main(null);
    }

    /**
     * Singleton to get this instance.
     * @return Worklet
     */
    public static ElogsWorklet getInstance() {
        return worklet;
    }

    /**
     * Gets the trades cache.
     * @return Cache
     */
    public TradesCache getTrades() {
        return trades;
    }
}
